/* 弹出层样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

/* 成功提示 */
.modal-success {
    padding: 2rem;
    text-align: center;
    min-width: 320px;
}

.modal-success .icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: successPulse 0.6s ease-out;
}

.modal-success .icon i {
    color: white;
    font-size: 24px;
}

.modal-success .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.modal-success .message {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.modal-success .button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-success .button:hover {
    background: #2563eb;
}

/* 错误提示 */
.modal-error {
    padding: 2rem;
    text-align: center;
    min-width: 320px;
}

.modal-error .icon {
    width: 64px;
    height: 64px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: errorShake 0.6s ease-out;
}

.modal-error .icon i {
    color: white;
    font-size: 24px;
}

.modal-error .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.modal-error .message {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.modal-error .button {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-error .button:hover {
    background: #dc2626;
}

/* 确认对话框 */
.modal-confirm {
    padding: 2rem;
    text-align: center;
    min-width: 360px;
}

.modal-confirm .icon {
    width: 64px;
    height: 64px;
    background: #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-confirm .icon i {
    color: white;
    font-size: 24px;
}

.modal-confirm .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.modal-confirm .message {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.modal-confirm .buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-confirm .button-cancel {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-confirm .button-cancel:hover {
    background: #e5e7eb;
}

.modal-confirm .button-confirm {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-confirm .button-confirm:hover {
    background: #2563eb;
}

/* 加载提示 */
.modal-loading {
    padding: 2rem;
    text-align: center;
    min-width: 280px;
}

.modal-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.modal-loading .message {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 动画 */
@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-success,
    .modal-error,
    .modal-confirm,
    .modal-loading {
        padding: 1.5rem;
        min-width: auto;
    }
    
    .modal-confirm .buttons {
        flex-direction: column;
    }
    
    .modal-confirm .button-cancel,
    .modal-confirm .button-confirm {
        width: 100%;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .modal-success .title,
    .modal-error .title,
    .modal-confirm .title {
        color: #f9fafb;
    }
    
    .modal-success .message,
    .modal-error .message,
    .modal-confirm .message,
    .modal-loading .message {
        color: #d1d5db;
    }
    
    .modal-confirm .button-cancel {
        background: #374151;
        color: #d1d5db;
    }
    
    .modal-confirm .button-cancel:hover {
        background: #4b5563;
    }
}
